package com.bustle.product.dto.product;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.commons.Mapper;

@Local
public interface ProductDtoMapper extends Mapper<ProductDto, ProductDto>
{
  @Stateless
  static public class DefaultProductDtoMapper implements ProductDtoMapper
  {
    @Override
    public ProductDto map(ProductDto aSource, ProductDto aDestination)
    {
      return dataToDtoMapConverter.map(dtoToDataMapConverter.convert(aSource), aDestination);
    }

    @EJB
    protected DtoToProductMapConverter dtoToDataMapConverter;
    @EJB
    protected ProductToDtoMapConverter dataToDtoMapConverter;
  }
}
